/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package arithmetic;

import intervalMath.ElementaryMath;
import java.math.*;
import java.util.Random;

/**
 *
 * @author fairdev
 */
public class Main {
    public static void main(String[] args) {
//        BigDecimal bd = new BigDecimal("5.14876865444");
        Random random = new Random();
        for(int x=0; x<100; x++){
          //  int r = random.nextInt(10);
            //
            double r = 5*random.nextDouble();
           BigDecimal arg = new BigDecimal(r);
           arg = arg.setScale(30,RoundingMode.CEILING);
          //  BigDecimal arg = new BigDecimal("5.14876865444");
           BigDecimal result = BigDecimalMath.sin(arg);
            BigDecimal result1 = ElementaryMath.sin(arg,15,RoundingMode.CEILING);
            //if (result.compareTo(result1)>=0.000000000001 || result.compareTo(result1)<=0.000000000001){
                //System.out.println(result);
                // System.out.println(result1);
           // }
                       System.out.println(result);
           System.out.println(result1);
        }
//        BigDecimal arg = new BigDecimal(5.87589);
//        BigDecimal result = BigDecimalMath.sin(arg);
//        BigDecimal result1 = ElementaryMath.sin(arg,8,RoundingMode.CEILING);
//        System.out.println(result);
//        System.out.println(result1);
    }
}
